import React, { useState, useEffect } from 'react';
import './Cursor.css';

const Cursor = () => {
  const [visible, setVisible] = useState(true);

  useEffect(() => {
    const interval = setInterval(() => {
      setVisible((prevVisible) => !prevVisible);
    }, 500); // 设置光标闪烁间隔为500毫秒

    return () => clearInterval(interval);
  }, []);

  return <span className={visible ? 'cursor' : 'cursor-hidden'}>|</span>;
};

export default Cursor;